﻿using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace testIOC
{
	public interface ILogger
	{
		void Debug(string msg);
	}

	public class ConsoleLogger : ILogger
	{
		public void Debug(string msg)
		{
			Console.WriteLine("Console Debug :" + msg);
		}
	}

	public interface IWindsorInstaller
	{
		void Install(IWindsorContainer container, IConfigurationStore store);
	}
	public class MyInstaller : IWindsorInstaller
	{
		public void Install(IWindsorContainer container, IConfigurationStore store)
		{
			container.Register(Component.For<ILogger>().ImplementedBy<ConsoleLogger>().LifestyleSingleton());
		}
	}

}
